var eff = "#fEffect/CharacterEff/1051296/1/0#";
var ttt = "#fUI/UIWindow/Quest/icon2/7#"; //"+ttt+"//美化1
var 笑脸 = "#fEtc/ItemPotLifeInfo/1000/state/good/0#"; //"+ttt+"//美化1
var 账户 = "#fUI/CashShop.img/CashItem_label/4#"; //"+ttt+"//美化1
var 赞助 = "#fUI/CashShop.img/CashItem_label/5#"; //"+ttt+"//美化1
var 点卷 = "#fUI/UIWindow5.img/ChewFoodTruck_ShopUI/coin#"; //"+ttt+"//美化1
var 抵用 = "#fUI/CashShop.img/CashItem_label/0#"; //"+ttt+"//美化1
var 活跃 = "#fUI/CashShop.img/CashItem_label/2#"; //"+ttt+"//美化1
var 积分 = "#fUI/CashShop.img/CashItem_label/3#"; //"+ttt+"//美化1
var PK = "#fUI/CashShop.img/CashItem_label/1#"; //"+ttt+"//美化1
var 村落 = "#fItem/Etc/0431.img/04310143/info/iconShop#"; //"+ttt+"//美化1
var 标题 = "#fUI/CashShop.img/CSBargainSale/SoldOut/0#"; //"+ttt+"//美化1
var 蘑菇 = "#fUI/UIWindow.img/Minigame/Common/mark#"; //"+ttt+"//美化1
var status = -1;

function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == 0) {
        cm.dispose();
        return;
    } else {
        status++;
    }
    if (status == 0) {
        var text = "  #r#e< 以下为当前您的账户详细 >：\r\n\r\n";
        text += "#L0##b#e  您的PPMS账号： #r" + format("", 15, cm.getClient().getAccountName()) + "#b #e#r#n#n#l\r\n\r\n";
        // text += "#L1##b#e" + 赞助 + "  您累计的赞助： #r" + format(" ", 15, cm.getTotalCostACash().toString()) + "#l\r\n\r\n";
        text += "#L2##b#e  您的点卷余额： #r" + format(" ", 15, cm.getNX(1).toString()) + "#l\r\n\r\n";
        text += "#L3##b#e  您的抵用余额： #r" + format(" ", 15, cm.getNX(2).toString()) + "#l\r\n\r\n";
        text += "#L4##b#e  您的PPMS活跃： #r" + format(" ", 15, cm.getPlayerPoints().toString()) + "#l\r\n\r\n";
        text += "#L5##b#e  您的PPMS微积： #r" + format(" ", 15, cm.getPlayerEnergy().toString()) + "#l\r\n\r\n";
        // text += "#L6##b#e" + PK + "  您的PK热力值： #r" + format(" ", 15, cm.getPvpNx().toString()) + "#l\r\n\r\n";
        text += "#L7##b#e  您的村落贡献： #r" + format(" ", 15, cm.getPlayer().getHyPay(1).toString()) + "#l\r\n\r\n \r\n";
        cm.sendSimple(text);
    } else if (status == 1) {
        switch (selection) {
            case 0:
                cm.dispose();
                cm.sendOk("#r请不要向任何人透露您的密码否则后果自负！\r\n#b如果过您需要修改密码请联系管理QQ：2756747596");
                break;
            case 1:
                cm.sendOk("#r本服采用点券累计消费数作为赞助统计.\r\n如果您觉得我们的服还不错可以酌情打赏我们\r\n#b可以联系管理QQ：2756747596 咨询打赏赞助礼包~");
                cm.dispose();
                break;
            case 2:
                cm.sendOk("#r点券可以用于购买PPMS冒险岛点券商城内的物品！");
                cm.dispose();
                break;
            case 3:
                cm.sendOk("#r抵用卷可以用于购买PPMS冒险岛抵用券商城内的物品！");
                cm.dispose();
                break;
            case 4:
                cm.sendOk("[获取方式]：打怪 打boss 成就系统都会获得\r\n[用途]：1.兑换会员 2.兑换特效图腾3.神秘徽章升级兑换");
                cm.dispose();
                break;
            case 6:
                cm.sendOk("[获取方式]：PK时.杀掉一个人即可获得 1点热力值\r\n[用途]：1.兑换斗神证物 2.兑换伤害皮肤 3.mvp称号及物品");
                cm.dispose();
                break;
            default:
                cm.dispose();
                cm.sendOk("正在整理中,敬请期待");
                break;
        }
    }
}


var format = function FormatString(c, length, content) {
    var str = "";
    var cs = "";
    if (content.length > length) {
        str = content;
    } else {
        for (var j = 0; j < length - content.getBytes("GB2312").length; j++) {
            cs = cs + c;
        }
    }
    str = content + cs;
    return str;
}